package com.sptpc.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


//Restful请求
//http get/post
//新建 post /url/ json    post /drink/{"name": "奶茶","price":"8.00"}
//修改 put /url/ json     put /drink/{"id": "1","price":"9.00"}
//删除 delete /url/id     delete /drink/1
//查看 get /url/id        get /drink/

@RestController
@RequestMapping("/hello")
public class HelloController {

    //get /hello/
    @GetMapping("/")
    public  String sayHi(@RequestParam("name") String name){
        return name + ",欢迎使用spring boot";
    }
}
